UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rFKG+u6SjAliRQCdhr2gMy8PmCsYOAdU1q3yoZjErFo='
WHERE
key_id = 'a9d0391494e6d60f5d080aaf80cf7d9f29ef2338957f7b42f610a2e6b740b5e2'
AND (
token = 'rFKG+u6SjAliRQCdhr2gMy8PmCsYOAdU1q3yoZjErFo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)