UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'O1o2B3kb82ox1g1sqLMLRFyphrMCaqh/4AzjDPHNOiw='
WHERE
key_id = '53d842d2bb640235ef5a485a1ca0716f983e6d959baaf7fd691fc3ce5d747c05'
AND (
token = 'O1o2B3kb82ox1g1sqLMLRFyphrMCaqh/4AzjDPHNOiw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)