UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Qe4p/M5YwrzYcAOpr/GZrScowYfa98ins/oFIQisv+g=' 
WHERE 
  key_id = 'f0e64c8a8da42e0f5be2da35f847f71db87b80aabf6b8e9a17386cc7f3f68e4e' 
  AND (
    token = 'Qe4p/M5YwrzYcAOpr/GZrScowYfa98ins/oFIQisv+g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00089