UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yTZS4EpQuvm76Zpky4pvHHcMW+ej1tNsby82X6zW5xk='
WHERE
key_id = 'e49707884c220d0073f10314f10ac0e33444b3710e277f495bb43f2702a1aba7'
AND (
token = 'yTZS4EpQuvm76Zpky4pvHHcMW+ej1tNsby82X6zW5xk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)