UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uVXYAxTJ8k6P5OA0s4bqOlXia3dFf7d6EmZmw+dRS0s=' 
WHERE 
  key_id = '8d3540d967ae6e49eb48e85d693f87040056c5cfdba71ff4c7373f2ebd7d213d' 
  AND (
    token = 'uVXYAxTJ8k6P5OA0s4bqOlXia3dFf7d6EmZmw+dRS0s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027