UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8rr1w5IoyHBLDrPBsq8Xb93UsKmhdnYHy3GSM2/kUig='
WHERE
key_id = '2971542d3390f433cf1432be3165f8e4c376d35053b6044f0caab86a95b2373f'
AND (
token = '8rr1w5IoyHBLDrPBsq8Xb93UsKmhdnYHy3GSM2/kUig='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)