UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RzkWHh2+9/0+31QRHA4qbUtxlhuuL8qyUiavJggv81g='
WHERE
key_id = 'e6a5566f7894c1372753ea73e17ffdfecf61a114818b42d1f9629e01cb5e8e61'
AND (
token = 'RzkWHh2+9/0+31QRHA4qbUtxlhuuL8qyUiavJggv81g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)