UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BiiPjQaPlzso7ExmLuI+Mx/sM31ql3tUXXPNCETLXD0=' 
WHERE 
  key_id = '0e2846921950c15ef35fd49b80db96b0a5bcd898f75fa99de3e1593d2dcab875' 
  AND (
    token = 'BiiPjQaPlzso7ExmLuI+Mx/sM31ql3tUXXPNCETLXD0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00064