UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4w5u7+HGghOQN/YZMHqRdck7Py3CBClvB1Ynu7ajJtU=' 
WHERE 
  key_id = 'aebf736d2f3241251fa85dcdedf21f0f379e1274d81dccbca726daeb88b20826' 
  AND (
    token = '4w5u7+HGghOQN/YZMHqRdck7Py3CBClvB1Ynu7ajJtU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028