UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'T0I0I5SU+oG69dqkZqGahZg+R13rEFewe0pNQgAk54I=' 
WHERE 
  key_id = 'e7dfdf6ed564bca1f96a9ab1b7a2a5f4cc83e44779287a4df0f90c07ae9dc86e' 
  AND (
    token = 'T0I0I5SU+oG69dqkZqGahZg+R13rEFewe0pNQgAk54I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031