UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sw/AbOkyNsNFO2d0rXmRRVwb5n/qEYe1FEYi6G9rAxQ='
WHERE
key_id = '0d85352cca62b44b0f541f9f2528e0bea32f05801579f64dbacd61f9d08f81a3'
AND (
token = 'sw/AbOkyNsNFO2d0rXmRRVwb5n/qEYe1FEYi6G9rAxQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)