UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KbYq5S7x+V1pPgK58/FlWOOkexKgDnWT+JeWpgV/PMQ='
WHERE
key_id = '6ff3441af7dd9bd4e08ec9b320a8f5846d0f6bcf921480293c0b8d03653d2be9'
AND (
token = 'KbYq5S7x+V1pPgK58/FlWOOkexKgDnWT+JeWpgV/PMQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)