UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Em3aZpA2EvPfpe7D84sDGT4K5p2iYcxpV46yPjn/zFE='
WHERE
key_id = '847abba1b99f39b7549f7f8e4ba538437998bd963ae04ea5cd984bae8788bf1c'
AND (
token = 'Em3aZpA2EvPfpe7D84sDGT4K5p2iYcxpV46yPjn/zFE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)