UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4oYqTF8vipI1C4rZCTFqd4SHlGEQbce4DeuG6PKopoQ='
WHERE
key_id = '61c4cee90f6a7415a9110f6e0a8dcd4482e338b05f9ebfc92c6613afadeb956b'
AND (
token = '4oYqTF8vipI1C4rZCTFqd4SHlGEQbce4DeuG6PKopoQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)