UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LlR5etP4WriUtsosT+aG6RbaYd2Nf+cuDsJ05oiApTQ='
WHERE
key_id = '6b5877010a1bc4401097f4470298dbec377fc85c1a2682cf524158d23d028fcf'
AND (
token = 'LlR5etP4WriUtsosT+aG6RbaYd2Nf+cuDsJ05oiApTQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)