UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sb7Gz+WSsHNLD50OK0Q7M8e8yfhs7LeKhJiHRl4WLtI=' 
WHERE 
  key_id = 'b89f934e8a59e457333cd7e087ebfb8e3d5988b7ebe38280dbb82fb05a0b7819' 
  AND (
    token = 'sb7Gz+WSsHNLD50OK0Q7M8e8yfhs7LeKhJiHRl4WLtI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028