UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'C30n0S2x0CCGbMSYvLosYs8Vd0r7C/ddwFxjcO4BaOk='
WHERE
key_id = '44dd5f546d22c3fe86da749c132431361379b5c70ace12aadc97882c282f224c'
AND (
token = 'C30n0S2x0CCGbMSYvLosYs8Vd0r7C/ddwFxjcO4BaOk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)