UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 't68Tcdxd6XgCt8dZ0qeOkUMwdoJlN2KRCjD0zIYNQjo=' 
WHERE 
  key_id = '0b801e405bab398c3951916ab03572b71b4e07f3388e281376fa8b63e2b8e75f' 
  AND (
    token = 't68Tcdxd6XgCt8dZ0qeOkUMwdoJlN2KRCjD0zIYNQjo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045