UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vxpJ7NrtNxz8/LvC4q+uHGLETMuj/9K6HSN5P1MN3Ao=' 
WHERE 
  key_id = 'c83507c19cf3530df7835727c66ba2edffcbbf3d44991666d4bce330df7595fa' 
  AND (
    token = 'vxpJ7NrtNxz8/LvC4q+uHGLETMuj/9K6HSN5P1MN3Ao=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032