UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's++fhRLAZgrTKVHYDjKS9jIYUEQVDcHA2BSdBoMv6As='
WHERE
key_id = '820762c9bf8c929f7f956505b962e374996fe8f39957bccc57a9622e852e7414'
AND (
token = 's++fhRLAZgrTKVHYDjKS9jIYUEQVDcHA2BSdBoMv6As='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)