UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FbPbiliJWHaf8XjowtVPKfoxDQx8xEeGZj578JoL4KQ=' 
WHERE 
  key_id = '03fd77a1fc7cd61fb017b2a129298243aae53c908f07a410fe013ba3028eda26' 
  AND (
    token = 'FbPbiliJWHaf8XjowtVPKfoxDQx8xEeGZj578JoL4KQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017