UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iXUxfCG0WiDPehkbZFQtizuE85n6omnSWC0256sFFtc='
WHERE
key_id = '205f0f732ec0decdef739af07ef6a5f6a311fdb25cf4c38ceee2cec338521e8d'
AND (
token = 'iXUxfCG0WiDPehkbZFQtizuE85n6omnSWC0256sFFtc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)