UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HLil0X9QTdaOUbzOSqZjfiQTDew2eEx/p4Vu7RdtLQU='
WHERE
key_id = 'dd2ff273c8d13e00872446f2393aeb2ebc93f4d0b848ece856f2e1bb263911a9'
AND (
token = 'HLil0X9QTdaOUbzOSqZjfiQTDew2eEx/p4Vu7RdtLQU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)