UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 's0F4HhDiqBeI5mdkA6kDw2DpBA2jyoFvQLY2DhqzsNs=' 
WHERE 
  key_id = '340f63c4720b33ea4c47bd4c69dbf1256ba6fc3f49dfc097a0c87d432d396799' 
  AND (
    token = 's0F4HhDiqBeI5mdkA6kDw2DpBA2jyoFvQLY2DhqzsNs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038