UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Oz26enupzr0UxMd9dLcX9dT+gvpVtNnFowo8f8H3qHA='
WHERE
key_id = 'af056669960c98359df32944aad9f4225a8790d36bd96e311d6e21ce5f2a99d6'
AND (
token = 'Oz26enupzr0UxMd9dLcX9dT+gvpVtNnFowo8f8H3qHA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)