UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7hWlbh7Vpqofp0sPeXm2Oh0tF/97T8aXEwBEh322U/Y='
WHERE
key_id = '8b67d7a71f9c1067bdb3078ebd1a2f65038cb57b01be23418efbcf4b178299da'
AND (
token = '7hWlbh7Vpqofp0sPeXm2Oh0tF/97T8aXEwBEh322U/Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)