UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '63iVWwp1WBzkGvz8t4au7btKiyOzLhcXwJ2j6UqSw0g=' 
WHERE 
  key_id = 'd1b53a9362e2392afb253a7a1efbf06b828e0dd352e1c763d2da262c7e1a74d7' 
  AND (
    token = '63iVWwp1WBzkGvz8t4au7btKiyOzLhcXwJ2j6UqSw0g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022