UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MFzaG0mG9vtUT2XzJ+tBcLa6OxxFROT32h++t4Z7PsU='
WHERE
key_id = 'd8a8849f6a64159d1ec071ffd86eb00e4236a34ca82187de583475611be2b360'
AND (
token = 'MFzaG0mG9vtUT2XzJ+tBcLa6OxxFROT32h++t4Z7PsU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)