UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/DO3brdFngYWxj/yVtMAqIeKa+dYsgY+WPo50ImEF3o=' 
WHERE 
  key_id = '28243e45a6795c1b183b92d66d453adbfad64f2dca9156145750572838b7d45a' 
  AND (
    token = '/DO3brdFngYWxj/yVtMAqIeKa+dYsgY+WPo50ImEF3o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017