UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'L/u/w0+n9G/I6ifG7HEtYSTC2JVwl96KF021yKxvE0k=' 
WHERE 
  key_id = 'cf956904e3abc5eabc7dfbf21afb22644165863abcc296230a01e0a80edbc339' 
  AND (
    token = 'L/u/w0+n9G/I6ifG7HEtYSTC2JVwl96KF021yKxvE0k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044