UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZFW+ExLVXm6+JQt3d+VfZEpUR1zL0Iw6lVSR39ZprxU='
WHERE
key_id = '01b583079b844c97f608d2644abcb68d2581d7d14202325c62425b3756b9eaea'
AND (
token = 'ZFW+ExLVXm6+JQt3d+VfZEpUR1zL0Iw6lVSR39ZprxU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)