UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'q9XN7NeJMk45UjEaqFdC4UV0bJxIbH/SeQrqcXvUsi0=' 
WHERE 
  key_id = 'dca20b9201268c43f20e015552e1ffc2d982d845c1aba824a68b6f3452c32f4e' 
  AND (
    token = 'q9XN7NeJMk45UjEaqFdC4UV0bJxIbH/SeQrqcXvUsi0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056