UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lwp1mF3QbL4p2sq6MGfvLXDRB5JGtpOZqlkRXcvZzFw=' 
WHERE 
  key_id = 'd5ebdc658a8a1e2ebd80cb9a5385d3b5559fcc076fc7ee880d8c029372308e15' 
  AND (
    token = 'lwp1mF3QbL4p2sq6MGfvLXDRB5JGtpOZqlkRXcvZzFw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00059