UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+Ci94ikz338zGz/VQPnz2N190vdEthJCQQau9hlLj/8=' 
WHERE 
  key_id = 'de806479d3fa86cdf993b1ebe325d7ccfa91fa51d5909ce6e29a52efdcda1ef2' 
  AND (
    token = '+Ci94ikz338zGz/VQPnz2N190vdEthJCQQau9hlLj/8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040