UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pgU1XNyPGCtMmHfr75qArgxCTQh6Ho1e1dz/KMy/ufY='
WHERE
key_id = '14d7240023e5eaffe9e4df7990f289997537f9a0f39698cc922c57b9eabf7af0'
AND (
token = 'pgU1XNyPGCtMmHfr75qArgxCTQh6Ho1e1dz/KMy/ufY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)