UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yvQGJYLCwnHUk4ok7FaAztDBluh/s8B+RsyvBhIt/Fo='
WHERE
key_id = '00e4260327b27143b55227d249e190124c2ec7a0f44d4d665c4ade9a9bd71fd5'
AND (
token = 'yvQGJYLCwnHUk4ok7FaAztDBluh/s8B+RsyvBhIt/Fo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)