UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+k2D5AfB9m+EnW2gGMWsrsQTteeX9fXMwxZDok0Hqh8=' 
WHERE 
  key_id = 'e2a8d9eeb91bb3066a3750318c9434edf198f49b70e44685f2b7ec3050040b5b' 
  AND (
    token = '+k2D5AfB9m+EnW2gGMWsrsQTteeX9fXMwxZDok0Hqh8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038