UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'J7SP58GXg9i6SHfGkD/+4X7ald5IwfH+PLnlIXmJCzs='
WHERE
key_id = 'c36dc766bb8427a708b958e6cd94ca6aed6337fb4ec97634358c3c43be51dd6f'
AND (
token = 'J7SP58GXg9i6SHfGkD/+4X7ald5IwfH+PLnlIXmJCzs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)