UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TjwhyEwq2/+0y+oMUHegpzRToM/zvSnWTkqlwCqQ2kY=' 
WHERE 
  key_id = 'e1ab14140c73524cab3e74f9ad7e21748be88b5b56d0a4e5addc5fd8faf7aeb3' 
  AND (
    token = 'TjwhyEwq2/+0y+oMUHegpzRToM/zvSnWTkqlwCqQ2kY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030