UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'T2Sp0juddZ3R0l2iPidTTPNiLG6zNBgi8UdlJodmOmI='
WHERE
key_id = 'ee572c3bd981941b47add94c3e27320e93a43cfc4fd74d6d9d121884472a34b2'
AND (
token = 'T2Sp0juddZ3R0l2iPidTTPNiLG6zNBgi8UdlJodmOmI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)