UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'i2BqnK+/8vTrd4b1WhQGG0xz6Lw15SvAS4XtfeSbBh4=' 
WHERE 
  key_id = '2681f121f04a5734cf52bf7286a673356cc736ab9a6ce74b1f5cf3d40d97a5b6' 
  AND (
    token = 'i2BqnK+/8vTrd4b1WhQGG0xz6Lw15SvAS4XtfeSbBh4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050