UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'F6ONd96ZwOR6DATH6zCmeMo1p8jDq06LR/yOkz+Ih2g='
WHERE
key_id = '7796205cdea16359981f783157c29cf806427a2e02c77cd2608302334b1793a6'
AND (
token = 'F6ONd96ZwOR6DATH6zCmeMo1p8jDq06LR/yOkz+Ih2g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)