UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BcH6rTsrsCGrRzLReKozWjV2t+EKEfMWIPjDlQ7tW3g='
WHERE
key_id = '1221deb6afb3262db87f2a35b7bbe953692a85bc466c9f4f2709ae66b378d038'
AND (
token = 'BcH6rTsrsCGrRzLReKozWjV2t+EKEfMWIPjDlQ7tW3g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)