UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vhOtl0oM4IOjU20w83/YRfobOPjszB2Gz1tI28Eewg8='
WHERE
key_id = '3b72fa3cfa48dea5f491a13a74b651bedb11695de570118c5b7ebd771288ba23'
AND (
token = 'vhOtl0oM4IOjU20w83/YRfobOPjszB2Gz1tI28Eewg8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)